package com.xunhang.utils;

import com.xunhang.dto.AdminDTO;


public class AdminHolder {
    private static final ThreadLocal<AdminDTO> tlAdmin=new ThreadLocal<>();
    private static final ThreadLocal<String>  tlToken=new ThreadLocal<>();

    public static void saveAdmin(AdminDTO adminDTO){
        tlAdmin.set(adminDTO);
    }
    public static AdminDTO getAdmin(){
        return tlAdmin.get();
    }
    public static void removeAdmin(){
        tlAdmin.remove();
    }
    public  static void saveToken(String token){
        tlToken.set(token);
    }
    public static String getToken(){
        return tlToken.get();
    }
    public static void  removeToken(){
        tlToken.remove();
    }
}
